home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q32660 < prev    next >
Text File  |  1988-07-21  |  970b  |  34 lines

  1. Q32660 far and _saveregs Access Parameters Incorrectly
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    Using the _saveregs attribute with a far function will cause the
  8. function to incorrectly access function parameters. The code that is
  9. generated does not take into account the extra two bytes that are on
  10. the stack for the far return address.
  11.    Microsoft has confirmed this to be a problem in Version 5.10. We
  12. are researching this problem and will post new information as it
  13. becomes available.
  14.    The following example illustrates this problem:
  15.  
  16. far _saveregs test2(int parm)
  17. {
  18.     printf("\nIn far _saveregs function, parm should be 7, is = %d\n",parm);
  19.     return (parm);
  20. }
  21.  
  22. main() {
  23.     int arg = 7;
  24.     printf("\nBefore call to far _saveregs func, argument = %d\n",arg);
  25.  
  26.     arg = test2(arg);
  27.  
  28.     printf("\nAfter  call to far _saveregs func, argument = %d\n",arg);
  29.     }
  30.  
  31.  
  32. Keywords:  buglist5.10 qfbv
  33. Updated  88/07/21 03:19
  34.